import layout from "@/layout/";

const meta = { auth: true, toolbar: true };

export default {
  path: "/user",
  name: "user",
  meta,
  redirect: { name: "user-index" },
  component: layout,
  children: (pre => [
    {
      path: "index",
      name: `${pre}index`,
      component: () => import("@/pages/user/index"),
      meta: { ...meta, title: "用户中心" }
    },
    {
      path: "i-like",
      name: `${pre}i-like`,
      component: () => import("@/pages/user/PostILike"),
      meta: { ...meta, title: "我的点赞" }
    },
    {
      path: "i-favorite",
      name: `${pre}i-favorite`,
      component: () => import("@/pages/user/PostIFavorite"),
      meta: { ...meta, title: "我的收藏" }
    },
    {
      path: "my-post",
      name: `${pre}my-post`,
      component: () => import("@/pages/user/PostByMe"),
      meta: { ...meta, title: "我的帖子" }
    },
    {
      path: "following",
      name: `${pre}following`,
      component: () => import("@/pages/user/FollowingList"),
      meta: { ...meta, title: "我的关注" }
    },
    {
      path: "follower",
      name: `${pre}follower`,
      component: () => import("@/pages/user/FollowerList"),
      meta: { ...meta, title: "关注我" }
    },
    {
      path: "my-comments",
      name: `${pre}my-comments`,
      component: () => import("@/pages/user/MyComments"),
      meta: { ...meta, toolbar: false, title: "我的评论" }
    }
  ])("user-")
};
